import type { BaseSearchModel } from "@/types";
import { createContext, useContext } from "react";

interface ListViewContext<TSearch> {
	searchModel: TSearch;
	setSearchModel: (searchModel: TSearch) => void;
}

export const ListViewContext =
	createContext<ListViewContext<BaseSearchModel> | null>(null);

export const useListViewContext = () => {
	return useContext(ListViewContext);
};
